package com.mars.demo.service;

import com.mars.demo.model.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class UserService {

    @RequestMapping(value = "/login", method = RequestMethod.POST)
    public String login(@RequestBody User user) throws Exception{
        if("admin".equals(user.getUsername()) && "123".equals(user.getPassword())){
            return "验证通过！";
        } else {
            return "验证不通过！！！";
        }
    }

}
